import React from 'react';
import Loadable from 'react-loadable';
// import path from "path";
const LoadingComponent = ({ isLoading, errors }) => {
    if(isLoading){
        return <div>Loading...</div>;
    } else if(errors){
        return <div>error</div>
    } else {
        return null;
    }
}
const AsyncApp = Loadable({
    loader: () => import("./pages/content"),
    loading: LoadingComponent,
    // serverSideRequirePath: path.join(__dirname, './pages/content'),
    // modules: ['./pages/content'],
    // webpack: () => [require.resolveWeak('./pages/content')],
    delay: 200,
    timeout: 10
});
const AsyncTest = Loadable({
    loader: () => import("./pages/test"),
    loading: LoadingComponent,
    // serverSideRequirePath: path.join(__dirname, './pages/test'),
    // modules: ['./pages/test'],
    // webpack: () => [require.resolveWeak('./pages/test')],
    delay: 200,
    timeout: 10
});
const AsyncDrag = Loadable({
    loader: () => import("./pages/drag"),
    loading: LoadingComponent,
    delay: 200,
    timeout: 10
});
const AsyncSign = Loadable({
    loader: () => import("./pages/signer"),
    loading: LoadingComponent,
    delay: 200,
    timeout: 10
});
const AsyncImagePreview = Loadable({
    loader: () => import("./pages/imagePreview"),
    loading: LoadingComponent,
    delay: 200,
    timeout: 10
});

export {
    AsyncApp, AsyncTest, AsyncDrag, AsyncSign
}